<?php

/**
 * SiswaOrangTuaWali form base class.
 *
 * @method SiswaOrangTuaWali getObject() Returns the current form's model object
 *
 * @package    alazhar
 * @subpackage form
 * @author     Ardhy Widodo
 * @version    SVN: $Id: sfDoctrineFormGeneratedTemplate.php 29553 2010-05-20 14:33:00Z Kris.Wallsmith $
 */
abstract class BaseSiswaOrangTuaWaliForm extends BaseFormDoctrine
{
  public function setup()
  {
    $this->setWidgets(array(
      'siswa_id'          => new sfWidgetFormInputHidden(),
      'orang_tua_wali_id' => new sfWidgetFormInputHidden(),
      'hubungan'          => new sfWidgetFormChoice(array('choices' => array('AYAH KANDUNG' => 'AYAH KANDUNG', 'IBU KANDUNG' => 'IBU KANDUNG', 'AYAH ANGKAT' => 'AYAH ANGKAT', 'IBU ANGKAT' => 'IBU ANGKAT', 'WALI' => 'WALI'))),
      'keterangan_wali'   => new sfWidgetFormInputText(),
      'created_at'        => new sfWidgetFormDateTime(),
      'updated_at'        => new sfWidgetFormDateTime(),
    ));

    $this->setValidators(array(
      'siswa_id'          => new sfValidatorChoice(array('choices' => array($this->getObject()->get('siswa_id')), 'empty_value' => $this->getObject()->get('siswa_id'), 'required' => false)),
      'orang_tua_wali_id' => new sfValidatorChoice(array('choices' => array($this->getObject()->get('orang_tua_wali_id')), 'empty_value' => $this->getObject()->get('orang_tua_wali_id'), 'required' => false)),
      'hubungan'          => new sfValidatorChoice(array('choices' => array(0 => 'AYAH KANDUNG', 1 => 'IBU KANDUNG', 2 => 'AYAH ANGKAT', 3 => 'IBU ANGKAT', 4 => 'WALI'), 'required' => false)),
      'keterangan_wali'   => new sfValidatorString(array('max_length' => 255, 'required' => false)),
      'created_at'        => new sfValidatorDateTime(),
      'updated_at'        => new sfValidatorDateTime(),
    ));

    $this->widgetSchema->setNameFormat('siswa_orang_tua_wali[%s]');

    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);

    $this->setupInheritance();

    parent::setup();
  }

  public function getModelName()
  {
    return 'SiswaOrangTuaWali';
  }

}
